package adsi.domain;

import java.util.*;
import adsi.persistence.*;

public class ProgrammedMaintenance {
    private long ID;
    private Calendar startDate;
    private long lineID;
    private long equipmentMaintenanceID;
    
    public ProgrammedMaintenance() {
        //values of -1 means no valid value.
        ID = -1;
        startDate = null;
        lineID = -1;
        equipmentMaintenanceID = -1;
    }

    public long getID() {
        return ID;
    }

    public void setID(long ID) throws EntityException {
        //Only DataService should set ID's, so we make sure the calling method
        //is of interfase DataServiceModel.
        Throwable t = new Throwable();
        if(!t.getStackTrace()[1].getClassName().equals(DataServiceModel.class.getName())) {
            throw new EntityException("Method can be called only from DataServiceModel instance.");
        }

        this.ID = ID;
    }

    public Calendar getStartDate() {
        return startDate;
    }

    public void setStartDate(Calendar fechaInicio) {
        this.startDate = fechaInicio;
    }

    public long getLineID() {
        return lineID;
    }

    public void setLineID(long lineID) {
        this.lineID = lineID;
    }

    public long getEquipmentMaintenanceID() {
        return equipmentMaintenanceID;
    }

    public void setEquipmentMaintenanceID(long equipmentMaintenanceID) {
        this.equipmentMaintenanceID = equipmentMaintenanceID;
    }

}
